
// #include "risefall_time.h"



#ifndef __RISE_FALL_TIME_H__
#define __RISE_FALL_TIME_H__

#include "config.h"
#include "rtc_dev.h"



// typedef struct {
//     unsigned char ucHour;//时
//     unsigned char ucMinite;//分
//     unsigned char ucSeconed;//秒
// }ScmTime;


 typedef struct {
	 unsigned char ucHour;   //时
	 unsigned char ucMinute; //分
	 unsigned char ucSecond; //秒
 } Time_HMS_st;



typedef struct{
    unsigned char ucSecond;           //[00]
    unsigned char ucMinute;           //[01]
    unsigned char ucHour;             //[02]
    unsigned char ucDay;              //[03]
    unsigned char ucDate;             //[04]
    unsigned char ucMonth;            //[05]
    unsigned char ucYear;             //[06]
}ScmDS3231Struct;



typedef struct {
    double d_SunRise;
    double d_SunDown;
	
}ScmSunTime;


typedef struct {
	double jd;
	double wd;
	int tz;
	ScmDS3231Struct ds_time;
}time_calc_pa_t;

typedef struct {
	Time_HMS_st time_rise;
	Time_HMS_st time_fall;
}risefall_time_t;
	

/**
get_sun_risefall_time() ：算日出日落时间
param:  lng,  经度
        lat,  纬度
        tz,   时区
        p_risefall_time :  返回 日出日落时间结构体
**/
//int get_sun_risefall_time(unsigned int lng, unsigned int lat, unsigned int tz, OUT risefall_time_t *p_risefall_time);
//int get_sun_risefall_time(unsigned int lng, unsigned int lat, unsigned int tz, OUT Time_HMS_st *p_rise, OUT Time_HMS_st *p_fall );

int get_sun_risefall_time(unsigned int lng, unsigned int lat, unsigned int tz, RTC_Data_st* rtc_now, OUT Time_HMS_st *p_rise, OUT Time_HMS_st *p_fall );



#endif    /////---------__RISE_FALL_TIME_H__-------------




















